﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace OverlakeApp.Views
{
    /// <summary>
    /// A page that shows the currently selected calendar day's events.
    /// </summary>
    public partial class ViewCalendarDayPage : PhoneApplicationPage
    {
        /// <summary>
        /// Initialize the ViewCalendarDayPage
        /// </summary>
        public ViewCalendarDayPage()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Fires when the page is navigated to.
        /// </summary>
        /// <param name="e">An object that contains the event data.</param>
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            lst.SelectedItem = null;
        }

        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count > 0)
            {
                NavigationService.Navigate(new Uri("/Views/ViewCalendarEventPage.xaml", UriKind.Relative));
            }
        }
    }
}